package jcommon.chap5_collection.map;

import java.util.Collection;

import org.apache.commons.collections.MultiMap;
import org.apache.commons.collections.map.MultiValueMap;

public class Multiple {

	public static void main(String[] args) {
		MultiMap map = new MultiValueMap();
		map.put("ONE", "TEST");
		map.put("ONE", "WAR");
		map.put("ONE", "CAR");
		map.put("ONE", "WEST");

		map.put("TWO", "SKY");
		map.put("TWO", "WEST");
		map.put("TWO", "SCHOOL");

		// At this point "ONE" should correspond to "TEST", "WAR", "CAR", "WEST"
		map.remove("ONE", "WAR");
		map.remove("ONE", "CAR");

		// The size of this collection should be two "TEST", "WEST"
		System.out.println(map.get("ONE"));
		Collection oneCollection = (Collection) map.get("ONE");
		System.out.println(oneCollection);

		// This collection should be "TEST", "WEST", "SKY", "WEST", "SCHOOL"
		System.out.println(map.values());

		// This collection should be "ONE", "TWO"
		System.out.println(map.keySet());
	}
}